<!-- 
1:链接好蓝牙
2:自动调起支付功能
3:支付成功后调用获取支付成功接口,判断是否支付成功
4:写入蓝牙特征,写入成功后,才能启动牙刷.

如果支付成功,关闭蓝牙.跳转到下一个页面
 
 
 
 -->




<style>
@keyframes siz {
	0% {
		color: #fff;
	}

	50% {
		color: blue;
	}

	100% {
		color: green;
	}
}

.langya6 {
	animation: siz 1s linear infinite;
}
</style>
<template>
	<view class="langya0">
		<!-- <view @click="flush">设备没有出来点击刷新</view> -->
		<view class="langya1">
			<image src="@/static/images/ly.png" mode="widthFix"></image>
		</view>
		<view class="nod100">
			<text class="nod1001">设备号:</text>
			<text class="nod1002">{{ list[0].name ? list[0].name : '未连接' }}</text>
		</view>
		<view class="langya2">
			<!-- openWeiXinAlipay 传递0 为type等于0 如果等于0说明是激活机身，反之 -->

			<!-- 	<view class="langya4" @click="openWeiXinAlipay(0)">
				<view class="">弹出刷头</view>
			</view> -->

			<view class="langya4" @click="openWeiXinAlipay(1)">
				<view class="">欢迎体验</view>
			</view>
			<!-- <view class="langya4" @click="openWeiXinAlipay">弹出刷头</view> -->
		</view>
		<view class="y-0-0">
			<view class="y-0">
				<image :src="yashua" mode=""></image>
			</view>
			<view class="y-0">
				<image :src="w1" mode=""></image>
			</view>
			<view class="y-0">
				<image :src="w3" mode=""></image>
			</view>
			<view class="y-0">
				<image :src="w4" mode=""></image>
			</view>
		</view>
	</view>
</template>

<script>
var that;
export default {
	data() {
		return {
			yashua: require('@/static/images/yashua.jpg'),
			w1: require('@/static/images/w2.jpg'),
			w3: require('@/static/images/w3.jpg'),
			w4: require('@/static/images/w4.jpg'),
			getUserInfo: {},
			// getUserInfoDataToken: false,
			showBtn: false,
			bleAdapter: {
				available: false
			},
			bleConnection: false,
			list: [],
			openPass: 'PBSS',
			openPcss: 'PCSS',
			serviceId: '',
			orderAliPayObj: 'orderAliPayObj',
			deviceId: '',
			timer25: null,
			type: 1,
			unids: '',
			timer: null,
			timerOpenLanYa: null,
			payTypeNull: null,
			ifZhiFu: 0,
			openLanYa: true //判断蓝牙是否开启，开启时就是true，没开启时会把值变成false，开启后自动变成true ，同时清除定时器
		};
	},
	onUnload: function () {
		// console.log('点击退出了111111');
		//在页面卸载时清除定时器有时会清除不了，可在页面跳转时清除
		clearInterval(that.payTypeNull);
		that.payTypeNull = null;
		// that.closeLanYa("")
	},
	onLoad() {
		that = this;
		// Promise.resolve()
		// 	.then(that.weixinAuther())
		// 	.then(that.setIntervalPayType())
	},
	onShow() {
		// location.reload()
		uni.removeStorageSync('uuids');
		uni.removeStorageSync(that.orderAliPayObj);
		this.weixinAuther();
		this.setIntervalPayType()
		uni.closeBluetoothAdapter({
			success() {},
			fail() {}
		});
		// Promise.resolve()
		// 	.then(that.weixinAuther())
		// 	// .then(that.openLanYaConne())
		// 	.then(that.setIntervalPayType())
	},
	onHide() {},
	methods: {
		onAdapter() {
			// console.log('启动-适配器-监听器');
			uni.onBluetoothAdapterStateChange(function (e) {
				// console.log('监听到适配器的状态 =》', JSON.stringify(e))
				that.bleAdapter = e;
			});
		},
		// flush(){
		// 	uni.reLaunch({
		// 		url:"/pages/index/lanya"
		// 	})
		// },
		// onConnection() {
		// 	console.log('启动-连接状态-监听器');
		// 	uni.onBLEConnectionStateChange(function(e) {
		// 		// that.bleConnection = e.connected
		// 		console.log('监听到蓝牙设备连接的状态 =》', JSON.stringify(e))
		// 		that.startBluetoothDevicesDiscovery()
		// 	})
		// },
		initBLEAdP() {
			// console.log("initBLEAdP")
			uni.openBluetoothAdapter({
				success: (res) => {
					//已打开
					uni.getBluetoothAdapterState({
						success: (res1) => {
							that.bleAdapter = {
								available: true
							};
							that.startBluetoothDevicesDiscovery();
						},
						fail(error) {
							uni.showToast({
								icon: 'none',
								duration: 2000,
								title: '查看手机蓝牙是否打开'
							});
						}
					});
				},
				fail: (err) => {
					that.list = [];
					console.log(err);
					//未打开
					uni.showToast({
						icon: 'none',
						duration: 2000,
						title: '请打开手机蓝牙'
					});
				}
			});
		},
		//目的是保持单个线程，否则js会在变量里面控制几个或者多个线程进行，这里保证只有一个
		cleanDingShi() {
			clearInterval(that.payTypeNull);
			that.payTypeNull = null;
			// console.log("定时任务已清理")
		},
		//开始搜索蓝牙设备
		startBluetoothDevicesDiscovery() {
			// console.log("startBluetoothDevicesDiscovery==>")
			if (!that.bleAdapter.available) {
				that.initBLEAdP();
				return;
			}
			uni.startBluetoothDevicesDiscovery({
				success(res) {
					// console.log("正在搜索蓝牙设备...,启动现设备监听", res)
					uni.onBluetoothDeviceFound((devices) => {
						// console.log("启动发现设备监听", devices)
						console.log('开始重新搜索蓝牙设备==>');
						that.getBluetoothDevices();
					});
				},
				fail(e) {
					uni.showToast({
						icon: 'none',
						duration: 2000,
						title: '搜索蓝牙失败，没有给支付宝定位权限或请检查定位是否开启'
					});
					that.list = [];
					// console.log("失败原因", e)
					// console.log('搜索蓝牙失败，错误码：' + (e.errCode || e.errMsg));
				}
			});
		},
		openLanYaConne() {
			that.initBLEAdP();
		},
		//获取在蓝牙模块生效期间所有已发现的蓝牙设备。包括已经和本机处于连接状态的设备
		getBluetoothDevices() {
			uni.getBluetoothDevices({
				success: (res) => {
					// #ifdef MP-ALIPAY
					var arr = res.devices;
					console.log('----搜索到的设备列表-----', arr);
					for (let i = 0, len = arr.length; i < len; i++) {
						if (that.list.indexOf(arr[i].deviceId) == -1) {
							// console.log('----this.list------', arr[i])
							if (arr[i].name != null && (arr[i].name.slice(0, 3) === 'WMD' || arr[i].name.slice(0, 3) === 'WMD')) {
								that.list.push({
									name: arr[i].name,
									deviceId: arr[i].deviceId
								});
								uni.setStorageSync('uuids', that.list[0].name.slice(4));
								return;
							}
						}
					}
					// #endif

					// #ifdef MP-WEIXIN
					console.log('----微信 搜索到的全部设备7-----', res.devices);
					var alldevices = res.devices.find((obj) => obj.name.indexOf('WMD') != -1 || obj.name.indexOf('WMD') != -1);
					if (alldevices) {
						console.log('----微信 搜索到的设备-----', alldevices);
						that.list.push(alldevices);
						that.connectToBLE(alldevices.deviceId);
						uni.setStorageSync('uuids', alldevices.name);
						return;
					}

					// #endif
					that.ifZhiFu = 2;
				},
				fail: (e) => {
					console.log('获取蓝牙设备错误，错误码：' + e.errCode);
				}
			});
		},
		// stopBluetoothDevicesDiscovery(types) {
		// 	uni.stopBluetoothDevicesDiscovery({
		// 		success: e => {
		// 			// that.getBLEDeviceServices()
		// 			console.log('停止搜索蓝牙设备:' + e.errMsg);
		// 		},
		// 		fail: e => {
		// 			console.log('停止搜索蓝牙设备失败，错误码：' + e.errCode);

		// 		}
		// 	});
		// },

		connectToBLE(deviceId) {
			that.deviceId = deviceId;
			uni.stopBluetoothDevicesDiscovery({});
			// console.log('----------------开始获取蓝牙服务-------------->',deviceId)
			uni.createBLEConnection({
				deviceId,
				success(e) {
					uni.showToast({
						title: '已成功连接上蓝牙设备'
					});
					that.getBLEDeviceServices();
					console.log('----------------开始获取蓝牙服务-------------->', that.type);
				}
			});
		},

		//获取蓝牙的所有服务
		getBLEDeviceServices() {
			// setTimeout(() => {
			uni.getBLEDeviceServices({
				// 这里的 deviceId 需要已经通过 createBLEConnection 与对应设备建立链接
				deviceId: that.deviceId,
				success: (res) => {
					console.log('获取到蓝牙所有的服务:', res);
					res.services.forEach((item) => {
						// #ifdef MP-WEIXIN
						if (item.uuid.indexOf('0000AD01') != -1 || item.uuid.indexOf('0001') != -1) {
							that.serviceId = item.uuid;
							// console.log("1800特征值", that.serviceId)
							//获取特征
							that.getBLEDeviceCharacteristics();
						}
						// #endif
						// #ifdef MP-ALIPAY
						// console.log("item==>", item)
						if (item.uuid.indexOf('0000AD01') != -1) {
							// that.characteristicId = item.characteristicId
							that.serviceId = item.uuid;
							that.getBLEDeviceCharacteristics();

							//console.log('characteristicId:', item.uuid)
							//利用传参的形势传给下面的notify，这里的uuid如果都需要用到，就不用做判断了，建议使用setTimeout进行间隔性的调用此方法
							// that.notifyBLECharacteristicValueChange(item
							// 	.characteristicId)
						}
						// #endif
					});
				}
			});
			// }, 500)
		},
		//获取蓝牙特征
		getBLEDeviceCharacteristics() {
			console.log('进入特征');
			setTimeout(() => {
				uni.getBLEDeviceCharacteristics({
					// 这里的 deviceId 需要已经通过 createBLEConnection 与对应设备建立链接
					deviceId: that.deviceId,
					// 这里的 serviceId 需要在 getBLEDeviceServices 接口中获取
					serviceId: that.serviceId,
					success: (res) => {
						// console.log('特征getBLEDeviceCharacteristics', res)
						that.characteristics = res.characteristics;
						// console.log('特征数组', that.characteristics)
						// "0000FFE1-0000-1000-8000-00805F9B34FB"
						res.characteristics.forEach((item) => {
							console.log('item---->', item);
							// #ifdef MP-WEIXIN
							if (item.uuid.indexOf('0000AD02') != -1 || item.uuid.indexOf('0003') != -1) {
								that.characteristicId = item.uuid;
								// that.showBtn = true
								//console.log('characteristicId:', item.uuid)
								//利用传参的形势传给下面的notify，这里的uuid如果都需要用到，就不用做判断了，建议使用setTimeout进行间隔性的调用此方法
								// that.notifyBLECharacteristicValueChange(item.uuid)
							}
							// #endif
							// #ifdef MP-ALIPAY

							if (item.characteristicId.indexOf('0000AD02') != -1) {
								// console.log('支付宝特征数组', item)
								that.characteristicId = item.characteristicId;
								// that.showBtn = true

								// that.notifyBLECharacteristicValueChange(item
								// 	.characteristicId)
								//利用传参的形势传给下面的notify，这里的uuid如果都需要用到，就不用做判断了，建议使用setTimeout进行间隔性的调用此方法
								// that.notifyBLECharacteristicValueChange(item.uuid)
							}
							// #endif
						});
						// #ifdef MP-WEIXIN
						// that.createorder();
						// that.writeBLECharacteristicValue(that.type == 0 ? that.openPcss : that.openPass, that.deviceId, that.serviceId, that.characteristicId);
						// #endif
					},
					fail: (res) => {
						that.showBtn = true;
						// console.log(res)
					}
				});
			}, 1000);
		},

		// 开盒流程
		async openWeiXinAlipay(type) {
			console.log('开合流程', that.list, type);
			that.type = type;
			if (that.list[0].name) {
				let data = that.getOrderInfo();

				//这里要
				//链接上后在跳出支付，解决没有电时候也需要跳转出来
				// #ifdef MP-WEIXIN
				that.openBluetoothAdapterPay('open');
				// #endif
				// #ifdef MP-ALIPAY
				that.createOrderAlipay();
				// #endif
			}
		},
		//支付宝创建订单
		createOrderAlipay() {
			let type = that.type;
			// console.log("that.list[0].name支付宝-----,", that.list[0].name)
			let payUrl = '';
			//假设后端处理是url方法
			if (type == 0) {
				//走激活合身
				payUrl = 'https://nbwmd.cn/api/order/alipay/pay';
			} else {
				//开盒子 这里url后面自己改
				payUrl = 'https://nbwmd.cn/api/order/alipay/pay';
			}
			uni.request({
				url: payUrl,
				data: {
					type,
					// guid: type == 0 ? "open2": "guid",//暂时商品参数唯一标识
					qty: 1, //数量
					latitude: '',
					longitude: '',
					address: '',
					device_id: that.list[0].name
				},
				header: {
					'Content-Type': 'application/json',
					token: that.getUserInfo.data.key
				},
				method: 'POST',
				success: (res) => {
					if (res.data.code == 200) {
						let obj = {};
						obj.trade_no = res.data.data.out_trade_no;
						obj.type = type;
						// that.orderAliPayObj = res.data.data.out_trade_no;
						uni.setStorageSync(that.orderAliPayObj, JSON.stringify(obj));
						console.log('--------获取支付宝订单编号------------------,', res.data.data);
						that.paymentAliHandler(res.data.data);
					}
				}
			});
		},
		paymentAliHandler(paymentParams) {
			// 使用支付宝支付接口
			uni.requestPayment({
				provider: 'alipay',
				orderInfo: paymentParams.trade_no,
				success: (res) => {},
				fail: () => {}
			});
		},
		getOrderInfo() {
			let value = uni.getStorageSync(that.orderAliPayObj);
			console.log('==================>>>>>>>>>>>>',value)
			return value;
		},
		async setIntervalPayType() {
			await that.cleanDingShi();
			// console.log('---执行定时任务payTypeNull--------------------------', that.payTypeNull)
			that.payTypeNull = setTimeout(() => {
			// #ifdef MP-WEIXIN
			that.openLanYaConne();
			// #endif

			// console.log("当前支付情况", that.ifZhiFu, that.list[0].name)
			// console.log('---执行定时任务--------------------------', that.payTypeNull);
			let value = that.getOrderInfo();
			// that.kaisuoKaiHeJiHuo()
			if (value) {
				that.payType();
			}

			}, 2000)
		},
		// payTypesss(){
		// 	let data=that.getOrderInfo();
		// 	if(!data){
		// 	  return
		// 	}
		// 	setTimeout(()=>{
		// 	// uni.showToast({
		// 	// 	title:""
		// 	// })
		// 	let data=that.getOrderInfo();
		// 	if(!data){
		// 		console.info("多余的开锁请求")
		// 	  return
		// 	}
		// 	console.log("开锁成功")
		// 	uni.clearStorageSync(that.orderAliPayObj)

		// 	},2000)
		// },
		closeLanYa(flag) {
			// uni.closeBLEConnection({
			// 	deviceId: that.deviceId,
			// 	success: (res) => {

			// 	},
			// 	fail: (res) => {
			// 		// console.log("closeLanYa==>", res)

			// 	}
			// });

			// uni.stopBluetoothDevicesDiscovery({});
			// //开盒后清空蓝牙数据，同时断开了蓝牙
			// uni.closeBLEConnection({
			// 	deviceId: that.deviceId
			// });
			uni.closeBluetoothAdapter({
				success() {},
				fail() {}
			});
			if (flag) {
				uni.removeStorageSync(that.orderAliPayObj);
				uni.navigateTo({
					url: '/pages/index/banner'
				});
			}
		},
		// 微信授权end
		payType() {
			let data = that.getOrderInfo();
			if (!data) {
				//防止重复调用
				return;
			}
			let obj = JSON.parse(data);
			// console.log("对象", obj)
			let type = obj.type;
			//复制回去可以做兼容
			that.type = type;
			uni.request({
				url: 'https://nbwmd.cn/api/order/getOrderInfoByOrderNo?orderNo=' + obj.trade_no,
				data: {},
				header: {
					'Content-Type': 'application/json'
				},
				method: 'GET',
				success: (res) => {
					// console.log('---------payType返回参数-------------------', res)

					if (res.data.code == 200) {
						if (res.data.data.status == 1) {
							that.kaisuoKaiHeJiHuo();
						}
						// uni.showToast({
						// 	title: res.data.data.status
						// })
					}
				}
			});
		},

		//开锁开盒一体
		kaisuoKaiHeJiHuo() {
			that.connectToBLE(that.list[0].deviceId);
		},

		// 支付宝创建订单
		// 支付时判断蓝牙是不是连接的
		openBluetoothAdapterPay(v) {
			let that = this;
			// if (v != 'open') {
			// 	that.createorder();
			// 	return;
			// }
			uni.openBluetoothAdapter({
				success: (res) => {
					console.log("怎么又进去了====>>>",res);
					// 开启支付，为了测试先注释掉
					// #ifdef MP-WEIXIN
					that.createorder();
					// #endif
					// #ifdef MP-ALIPAY
					that.createOrderAlipay();
					// #endif
				},
				fail: (res) => {
					// that.showButton = false;
					uni.showModal({
						title: '提示',
						content: '请开启蓝牙后，重新扫码'
					});

					if (res.errCode === 10001) {
					}
				}
			});
		},
		// 微信创建订单
		createorder() {
			// console.log('----token------',that.getUserInfo.data.token)
			let type = that.type;
			//type等于0是激活身
			let payUrl = '';
			if (type == 0) {
				payUrl = 'https://nbwmd.cn/api/order/wechat/pay';
			} else {
				payUrl = 'https://nbwmd.cn/api/order/wechat/pay';
			}
			//0开盒金额  1 激活金额
			uni.request({
				url: payUrl,
				data: {
					type,
					// type:type == 0?"0": "1",
					qty: 1,
					address: '',
					latitude: '',
					longitude: '',
					device_id: that.list[0].name
				},
				header: {
					'Content-Type': 'application/json',
					token: that.getUserInfo.data.key
				},
				method: 'POST',
				success: (res) => {
					let obj = {};
					obj.trade_no = res.data.data.out_trade_no;
					obj.type = type;
					// that.orderAliPayObj = res.data.data.out_trade_no;
					uni.setStorageSync(that.orderAliPayObj, JSON.stringify(obj));
					// uni.setStorageSync('orderAliPay', res.data.data.order_no)
					console.log('微信支付成功--------------->', res);

					// 	that.deviceId, that.serviceId, that.characteristicId, 0X22, true);

					uni.requestPayment({
						provider: 'wxpay', // 服务提提供商
						timeStamp: res.data.data.timeStamp, // 时间戳
						nonceStr: res.data.data.nonceStr, // 随机字符串
						package: res.data.data.package,

						signType: res.data.data.signType, // 签名算法
						paySign: res.data.data.paySign, // 签名
						success: function (res) {
							console.log('支付成功', res);
							that.writeBLECharacteristicValue(that.type == 0 ? that.openPcss : that.openPass, that.deviceId, that.serviceId, that.characteristicId, 0x22, true);
						},
						fail: function (err) {
							// console.log('支付失败', err);
						}
					});
				}
			});
		},

		hexStringToArrayBuffer(str) {
			if (!str) {
				return new ArrayBuffer(0);
			}
			var buffer = new ArrayBuffer(str.length / 2);
			let dataView = new DataView(buffer);

			let ind = 0;
			for (var i = 0, len = str.length / 2; i < len; i += 1) {
				let code = parseInt(str.substr(2 * i, 2), 16);

				dataView.setUint8(ind, code);
				ind++;
			}
			return buffer;
		},

		//   arrayToBuffer(array) {
		//   var buffer = new ArrayBuffer(array.length);
		//   var view = new Uint8Array(buffer);
		//   for (var i = 0; i < array.length; i++) {
		//     view[i] = array[i];
		//   }
		//   return buffer;
		// },

		// UUID:0xAD01（服务）
		// UUID:0xAD02(特征写)
		// UUID:0xAD03(特征notify)

		// APP发送	0xAA 	0x04	0x11	0x55	板子亮蓝灯
		// APP发送	0xAA 	0x04	0x22	0x55	板子亮灭灯

		// 短按板子开机键发送数据给APP	0xAB 	0x04	0x11	0x55	预留

		// stringToBytes(str){
		// 			var array = new Uint8Array(str.length);
		// 			for(var i=0,l=str.length;i<l; i++){
		// 				array[i]= str.charcodeAt(i);
		// 		         console.log(array);return array.buffer
		// 		       }
		// 		},
		// 开机未连接：白灯闪烁；已连接：白灯常亮
		// ab2str: function(buf) {
		//     return String.fromCharCode.apply(null, new Uint8Array(buf));
		// },
		// ArrayBuffer转16进度字符串示例

		bufferToHex(buffer) {
			var hexArr = Array.prototype.map.call(new Uint8Array(buffer), function (bit) {
				return ('00' + bit.toString(16)).slice(-2);
			});
			return hexArr.join('');
		},

		//写入蓝牙 这页面传入PCSS是唤醒功能
		writeBLECharacteristicValue(v, deviceId, serviceId, characteristicId, data = 0x11, flag = false) {
			let buffer = new ArrayBuffer(4);
			let dataView = new DataView(buffer);
			dataView.setUint8(0, 0xaa);
			dataView.setUint8(1, 0x04);
			dataView.setUint8(2, data);
			dataView.setUint8(3, 0x55);
			console.error('ddddddddddd', that.deviceId, that.serviceId, that.characteristicId, that.ab2hex(buffer));
			uni.writeBLECharacteristicValue({
				deviceId,
				serviceId,
				characteristicId,
				value: buffer,
				success(res) {
					console.log('--开盒成功后返回数据-----------', res);
					// if (flag) {
					// 	uni.clearStorageSync(that.orderAliPayObj);
					// 	setTimeout(() => {
					// 		that.closeLanYa(true);
					// 	}, 1000);
					// }
                    that.closeLanYa(true);
					// setTimeout(()=>{
					// 	uni.showToast({
					// 		icon: 'none',
					// 		title: "开启成功"
					// 	})
					// },3000)

					// uni.switchTab({
					// 	url: '/pages/index/index'
					// })
				},
				fail(res) {
					that.showBtn = true;
					console.log('写入失败不允许错误', JSON.stringify(res));
				}
			});
		},

		// ArrayBuffer转16进度字符串示例
		ab2hex(buffer) {
			const hexArr = Array.prototype.map.call(new Uint8Array(buffer), function (bit) {
				return bit.toString(16).slice(-2);
			});
			return hexArr.join('');
		},
		// 微信开盒start

		// 微信开盒end

		// 微信授权start
		weixinAuther() {
			// this.getUserInfo = {};
			// this.showBtn = false;
			// this.bleAdapter = {
			// 	available: false
			// };
			// this.bleConnection = false;
			// this.list = [];
			// this.openPass = 'PBSS';
			// this.openPcss = 'PCSS';
			// this.serviceId = '';
			// this.orderAliPayObj = 'orderAliPayObj';
			// this.deviceId = '';
			// this.timer25 = null;
			// this.type = 1;
			// this.unids = '';
			// this.timer = null;
			// this.timerOpenLanYa = null;
			// this.payTypeNull = null;
			// this.ifZhiFu = 0;
			// this.openLanYa = true;

			// #ifdef MP-WEIXIN
			wx.login({
				success(res) {
					that.getawardDetail(res.code);
				}
			});
			// #endif
			// #ifdef MP-ALIPAY
			that.userAlipayLoginCode();

			// #endif
		},
		// 支付宝登录授权认证
		userAlipayLoginCode() {
			my.getAuthCode({
				scopes: 'auth_user',
				success: (res) => {
					that.alipayLogin(res.authCode);
				}
			});
		},
		alipayLogin(code) {
			uni.request({
				url: 'https://nbwmd.cn/api/user/alipay/login',
				data: {
					code
				},
				header: {
					'Content-Type': 'application/json'
				},
				method: 'POST',
				success: (res) => {
					let { data } = res;
					if (data.code == 200) {
						// console.log('===支付宝====', res)
						that.getUserInfo = data;
					}
				}
			});
		},
		async getawardDetail(code) {
			await uni.request({
				url: 'https://nbwmd.cn/api/user/wechat/login',
				data: {
					code
				},
				header: {
					'Content-Type': 'application/json'
				},
				method: 'POST',
				success: (res) => {
					that.getUserInfo = res.data;
					console.log(' getawardDetail ====888888888888888888888888888888888888888====', that.getUserInfo);
					that.setIntervalPayType();
				}
			});
		}
	}
};
</script>

<style lang="scss" scoped>
.langya0 {
	min-height: 100vh;
	background-color: #4e85fd;
	padding-top: 300rpx;

	.langya5 {
		color: #fff;
		text-align: center;
		margin: 40rpx 0;
		font-size: 18px;
	}

	.langya1 {
		width: 200rpx;
		height: 200rpx;
		margin: 0 auto;
	}

	.langya1 image {
		width: 100%;
		height: 100%;
	}

	.langya2 {
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-around;
		margin: 0 auto;
		margin-top: 60rpx;

		.langya3 {
			width: 260rpx;
			background-color: #fff;
			padding: 10rpx;
			font-size: 34rpx;
			border-radius: 200rpx;
			// margin-right: 10rpx;
			color: #4e85fd;
			text-align: center;
		}

		.langya4 {
			width: 400rpx;
			text-align: center;
			background-color: #fff;
			padding: 10px;
			font-size: 25px;
			border-radius: 100rpx;
			margin-left: 10rpx;
			color: #4e85fd;
		}
	}
}

.nod100 {
	text-align: center;
	margin-bottom: 100rpx;
	margin-top: 60rpx;
}

.nod1001 {
	font-size: 30rpx;
	color: #fff;
}

.nod1002 {
	font-size: 30rpx;
	color: #fff;
	font-weight: bold;
	margin-left: 10rpx;
}

.y-0-0 {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-around;
	margin-top: 100rpx;
	flex-wrap: wrap;
}

.y-0 {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	border-radius: 20rpx;
	overflow: hidden;
	width: 360rpx;
	height: 400rpx;
	margin-bottom: 14rpx;

	image {
		width: 100%;
		height: 100%;
		overflow: hidden;
	}
}
</style>
